/*----------------------------------------------------------------------
  - File name      : STC8Ax_RST.h
  - Author         : Quark Team
  - Update date    : 2020-12-09                   
  -	Copyright      : Gevico Electronic studio   
  - Module comments: Header file of Reset module.
-----------------------------------------------------------------------*/
#ifndef __STC8Ax_RST_H_
#define __STC8Ax_RST_H_
/*-----------------------------------------------------------------------
|                               INCLUDES                                |
-----------------------------------------------------------------------*/
/*--------------------------------------------------------
| @Description: STC8Ax Options                           |
--------------------------------------------------------*/
#include "STC8Ax_REG.h"   
/*--------------------------------------------------------
| @Description: STC8Ax core                              |
--------------------------------------------------------*/
#include "STC8Ax_CORE.h"
/*-----------------------------------------------------------------------
|                                 DATA                                  |
-----------------------------------------------------------------------*/

/*--------------------------------------------------------
| @Description: Software reset selection enum            |
--------------------------------------------------------*/

typedef enum
{

	RST_USER_DATA_KEEP ,	/* After the software is reset,
                            the code is executed from the user program area, 
                            and the data in the user data area remains unchanged. */
	RST_USER_DATA_CLEAN 	/* After the software is reset,
                            the code is executed from the ISP area of the system,
                            and the data in the user data area is cleared. */
} RSTChoice_Type;

/*--------------------------------------------------------
| @Description: Low voltage reset Reset working mode enum|
--------------------------------------------------------*/

typedef enum
{
  LVD_RST_2_2V,
  LVD_RST_2_4V,
  LVD_RST_2_7V,
  LVD_RST_3_0V
} LVDRstDiv_Type;


/*-----------------------------------------------------------------------
|                             API FUNCTION                              |
-----------------------------------------------------------------------*/

/*--------------------------------------------------------
| @Description: Reset  control functions                 |
--------------------------------------------------------*/

#define    P54_RST_ENABLE()      RSTCFG |= 0x10
#define    P54_RST_DISABLE()     RSTCFG &= 0xEF

/*--------------------------------------------------------
| @Description: Reset  control functions                 |
--------------------------------------------------------*/

FSCSTATE SFW_RST_Ctrl(RSTChoice_Type Choice, FUNSTATE State);
FSCSTATE LVD_RST_Init(LVDRstDiv_Type LVDiv,FUNSTATE State);


#endif
/*-----------------------------------------------------------------------
|          END OF FLIE        (C) COPYRIGHT Gevico Electronics          | 
-----------------------------------------------------------------------*/